package com.account.boot.commons.exception;

import com.account.boot.commons.result.ResultCodeEnum;

public class APIException extends RuntimeException
{
    /**
     * 
     */
    private static final long serialVersionUID = 6175953469791027763L;
    private int resultCode;
    private String errorMessage;

    public APIException(ResultCodeEnum code)
    {
        super(code.getMessage());
        this.resultCode = code.getResultCode();
        this.errorMessage = code.getMessage();
    }
    
    public APIException(int resultCode, String errorMessage)
    {
        super(errorMessage);
        this.resultCode = resultCode;
        this.errorMessage = errorMessage;
    }

    public int getResultCode()
    {
        return this.resultCode;
    }

    public String getErrorMessage()
    {
        return this.errorMessage;
    }
}
